package com.clarence.dada.modular.system.user.entity.req;


import com.clarence.dada.core.base.BaseReq;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 登录的请求参数
 *
 * @author GD
 * @since 2020/10/19 14:02
 */
@Data
@Schema(title = "登录请求实例")
@EqualsAndHashCode(callSuper = true)
public class LoginReq extends BaseReq {

    /**
     * 账号
     */
    @NotBlank(message = "账号不能为空")
    @Schema(title = "账号", example = "admin")
    private String account;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空")
    @Schema(title = "密码", example = "******")
    private String password;

    /**
     * 记录会话，7天免登录
     */
    @Schema(title = "记录会话，7天免登录", example = "false")
    private Boolean rememberMe = false;

    /**
     * 验证码图形对应的缓存key
     */
    @Schema(title = "验证码图形对应的缓存key", example = "userKey")
    private String verKey;

    /**
     * 用户输入的验证码的值
     */
    @Schema(title = "用户输入的验证码的值", example = "8888")
    private String verCode;

    /**
     * 是否写入cookie会话信息
     */
    @Schema(title = "是否写入cookie会话信息", example = "false")
    private Boolean createCookie = false;


    /**
     * 取消账号冻结
     */
    public @interface cancelFreeze {
    }

}
